<?php
namespace app\service;
use think\Db;
class commonService{
    //查询用户信息
    public function adminIdInfo($id){
        return Db::name('admin')->where('id',$id)->find();
    }
    //查询所有服务商
    public function serviceList(){
        return Db::name('service')->column('id');
    }
    //查询所有物业
    public function propertyList(){
        return Db::name('property')->column('id');
    }
    //查询所有小区
    public function communityList(){
        return Db::name('community')->column('community_id');
    }
    //查询服务商下所有物业
    public function serviceIdProperty($department){
        return Db::name('property')->where('service_id',$department)->column('id');
    }
    //查询物业下的所以小区
    public function propertyIdCommunity($propertylist){
        return Db::name('community')->where('property_id','in',$propertylist)->column('community_id');
    }
    //查询小区下的所以小区
    public function communityIdCommunity($id){
        return Db::name('community')->where('id',$id)->value('community_id');
    }
}